<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
	prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
	prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"
	prefix="logic"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
	prefix="tiles"%>
<%@ taglib uri="/WEB-INF/navigationTag.tld" prefix="nav"%>
<html>
	<head>
		<html:base />
		<title>AGV Software</title>

		<link rel="stylesheet" media="screen" href="/agvWeb/css/superfish.css" />
		<link rel="stylesheet" href="/agvWeb/css/agvStyle.css" />
		<link rel="stylesheet" href="/agvWeb/css/jquery.ui.all.css" />
		<link type="text/css" href="/agvWeb/css/jquery.ui.selectmenu.css"
			rel="stylesheet" />
		<script src="/agvWeb/js/jquery-1.5.1.js"></script>
		<script src="/agvWeb/js/jquery.bgiframe-2.1.2.js"></script>
		<script src="/agvWeb/js/jquery.ui.core.js"></script>
		<script src="/agvWeb/js/jquery.ui.widget.js"></script>
		<script src="/agvWeb/js/jquery.ui.mouse.js"></script>
		<script src="/agvWeb/js/jquery.ui.draggable.js"></script>
		<script src="/agvWeb/js/jquery.ui.button.js"></script>
		<script src="/agvWeb/js/jquery.ui.position.js"></script>
		<script src="/agvWeb/js/jquery.ui.dialog.js"></script>
		<script src="/agvWeb/js/jquery.ui.accordion.js"></script>
		<script type="text/javascript"
			src="/agvWeb/js/jquery.ui.selectmenu.js"></script>

		<script src="/agvWeb/js/hoverIntent.js"></script>
		<script src="/agvWeb/js/superfish.js"></script>
		<script src="/agvWeb/js/supersubs.js"></script>

		<script type="text/javascript">

			$(function() {
				// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
				$( "#dialog:ui-dialog" ).dialog( "destroy" );
			
				$( "#dialog-confirm" ).dialog({
					autoOpen: false,
					resizable: true,
					modal: true,
					buttons: {
						"cerrar sesión": function() {
							document.forms[0].action = "/agvWeb/hdrAdm.do?method=hdrCerrarSesion";
							document.forms[0].submit();
						},
						"cancelar": function() {
							$( this ).dialog( "close" );
						}
					}
				});

				$( "#dialog-confirm2" ).dialog({
					autoOpen: false,
					resizable: true,
					height: 170,
					modal: true,
					buttons: {
						"ir a inicio": function() {
							document.forms[0].action = "/agvWeb/hdrAdm.do?method=hdrInicio";
							document.forms[0].submit();
						},
						"cancelar": function() {
							$( this ).dialog( "close" );
						}
					}
				});
			});

			$(function() {
				$( "#draggable" ).draggable({ axis: "y" });
				$( "#draggable2" ).draggable({ axis: "x" });
		
				$( "#draggable3" ).draggable({ containment: "#containment-wrapper", scroll: false });
				$( "#draggable4" ).draggable({ containment: "#demo-frame" });
				$( "#draggable5" ).draggable({ containment: "parent" });
			});

			$(function() {
				$( "#editar" ).button({
					text: true,
					icons: {
						primary: "ui-icon-pencil"
					}
				});
				$( "#eliminar" ).button({
					text: true,
					icons: {
						primary: "ui-icon-close"
					}
				});
				$( "#agregar" ).button({
					text: true,
					icons: {
						primary: "ui-icon-plus"
					}
				})
				.click(function() {
				});

				$( "#guardar" ).button({
					text: true,
					icons: {
						primary: "ui-icon-check"
					}
				})
				.click(function() {
					guardarDatos();
				});

				$( "#deshacer" ).button({
					text: true,
					icons: {
						primary: "ui-icon-arrowreturnthick-1-w"
					}
				})
				.click(function() {

				});

				$( "#rehacer" ).button({
					text: true,
					icons: {
						primary: "ui-icon-arrowreturnthick-1-e"
					}
				});

				$( "#borrar" ).button({
					text: true,
					icons: {
						primary: "ui-icon-document"
					}
				}).click(function(){
					limpiarDatos();
				});

				$( "#info" ).button({
					text: true,
					icons: {
						primary: "ui-icon-info"
					}
				});
				$( "#ayuda" ).button({
					text: true,
					icons: {
						primary: "ui-icon-help"
					}
				});
		
				$( "#irInicio" ).button({
					text: true,
					icons: {
						primary: "ui-icon-home"
					}
				}).click(function() {
						$( "#dialog-confirm2" ).dialog( "open" );
					});
		
				$( "#cerrarSesion" ).button({
					text: true,
					icons: {
						primary: "ui-icon-extlink"
					}
				}).click(function() {
						$( "#dialog-confirm" ).dialog( "open" );
					});
					

				$( "#buscarBtn" ).button({
					text: false,
					icons: {
						primary: "ui-icon-search"
					}
				});
				

			});
		</script>

		<style type="text/css">
select,.ui-select-menu {
	float: left;
	margin-right: 10px;
}

select {
	width: 230px;
}

.wrap span.ui-selectmenu-item-header,.wrap ul.ui-selectmenu-menu li a {
	text-decoration: underline !important;
}
</style>

		<style>
div#menu {
	height: 55px;
	background: url(/agvWeb/images/nav-bg.png) repeat-x -100px 0px 0px 0px;
}

.draggable {
	padding: 0.0em;
	float: right;
}

#draggable,#draggable2 {
	margin-bottom: 0px;
}

#draggable {
	cursor: move;
}

#draggable2 {
	cursor: move;
}

#containment-wrapper {
	width: 95%;
	height: 150px;
	border: 2px solid #ccc;
}

div#menu {
	margin: 20px auto;
}

input.text {
	margin-bottom: 3.5px;
	margin-right: 2px;
}
</style>

		<script type="text/javascript">
				
			function irInicio() {
				document.forms[0].submit();
			}
			
			function cerrarSesion() {
				document.forms[0].action = "/agvWeb/hdrAdm.do?method=hdrCerrarSesion";
				document.forms[0].submit();
			}
		
		</script>

	</head>
	<body style="margin: 0em;">
		<table width="100%" style="height: 100%;">
			<tbody>
				<tr class="headerleft" height="100px">
					<td>
						<div class="headercenter" style="width: 99%;">
							<span class="headerright" style="width: 100%;"> <html:form
									action="/hdrAdm.do?method=hdrInicio"></html:form>
								<div align="left"
									style="padding-top: 5px; vertical-align: middle;">
									<table border="0" width="100%">
										<tr>
											<td
												style="margin: 0; padding: 0; height: 20px; vertical-align: middle"
												align="left">
												<img src="/agvWeb/images/user.png" />
												<font color="#FFFFFF"
													style="font-family: sans-serif; font-weight: bold; font-size: 12px; vertical-align: middle;"><bean:write
														name="usuarioObj" property="nbUsuario" /> </font> &nbsp;
												<img src="/agvWeb/images/divider.jpg"
													style="vertical-align: middle; height: 36px;" />
												&nbsp;
												<font color="#FFFFFF"
													style="font-family: sans-serif; font-weight: bold; font-size: 12px; vertical-align: middle;"><bean:write
														name="perfilObj" property="tpPerfil" /> </font>
											</td>
											<td style="padding-right: 10px; vertical-align: middle;"
												align="right" rowspan="2">
												<button id="irInicio"
													title="ir a la p&aacute;gina inicial del sistema">
													inicio
												</button>
												<img src="/agvWeb/images/divider.jpg"
													style="vertical-align: top; height: 30px;" />
												&nbsp;
												<button id="cerrarSesion"
													title="cerrar sesi&oacute; en el sistema">
													cerrar sesi&oacute;n
												</button>
											</td>
										</tr>
										<tr>
											<td style="height: 15px; padding-right: 10px;" align="left">
												<font color="#FFFFFF"
													style="font-family: sans-serif; font-weight: bold; font-size: 10px;">&Uacute;ltimo
													inicio de sesi&oacute;n : <bean:write name="usuarioObj"
														property="tmUltimoAcceso" /> </font>
											</td>
										</tr>
										<tr>
											<td align="left" colspan="2">

												<div id="menu"
													style="margin-bottom: 0px; margin-top: 0px; margin-right: 10px;">
													<ul class="sf-menu">

														<logic:iterate id="modIter" name="usuarioObj"
															property="modulos"
															type="com.agv.core.objectDomain.Modulo">
															<li class="current">
																<a><bean:write name="modIter" property="nbModulo" />
																</a>
																<ul>
																	<logic:iterate id="subModIter" name="modIter"
																		property="subModulos" scope="page"
																		type="com.agv.core.objectDomain.SubModulo">

																		<li class="current">
																			<a><bean:write name="subModIter"
																					property="nbSubModulo" /> </a>
																			<ul>
																				<logic:iterate id="funcionIter" name="subModIter"
																					property="funciones" scope="page"
																					type="com.agv.core.objectDomain.Funcion">
																					<li class="current">
																						<a onclick="guardarRuta(this)"
																							href="<bean:write name='funcionIter' property='nbRuta' />"
																							name="<%=modIter.getNbModulo()
															.trim()
													+ "."
													+ subModIter
															.getNbSubModulo()
															.trim()
													+ "."
													+ funcionIter
															.getNbFuncion()
															.trim()%>"
																							style="height: 31px; width: 150px; cursor: pointer;"
																							id='<bean:write name='funcionIter' property='nbRuta' />'><bean:write
																								name="funcionIter" property="nbFuncion" /> </a>
																					</li>
																				</logic:iterate>
																			</ul>
																		</li>
																	</logic:iterate>
																</ul>
															</li>

														</logic:iterate>

													</ul>

												</div>

											</td>
										</tr>
									</table>
								</div>

								<div id="dialog-confirm"
									title="AGV Software - Cerrar Sesi&oacute;n">
									<p style="padding-top: 10px;">
										<span class="ui-icon ui-icon-alert"
											style="float: left; margin: 0 7px 20px 0;"></span>&iquest;
										Desea finalizar su sesi&oacute;n ?
									</p>
								</div>
								<div id="dialog-confirm2" title="AGV Software - Ir a inicio">
									<p style="padding-top: 10px;">
										<span class="ui-icon ui-icon-alert"
											style="float: left; margin: 0 7px 20px 0;"></span>&iquest;
										Desea cancelar la acci&oacute;n actual e ir a la
										p&aacute;ginna de inicio ?
									</p>
								</div> </span>

						</div>
					</td>
				</tr>
				<tr style="height: 100%; vertical-align: top;">
					<td>
						<table cellpadding="0" cellspacing="0" border="0"
							style="width: 100%; height: 100%; margin: 0px;">
							<tr>
								<td style="width: 15px; height: 46px; vertical-align: bottom;">
									<img src="/agvWeb/images/TopLeft.png"
										style="margin: 0px; width: 15px; height: 46px; vertical-align: bottom;" />
								</td>
								<td
									style="width: 100%; padding-top: 10px; text-align: left; background: #FFFFFF url('/agvWeb/images/Top.png') repeat-x bottom;"
									valign="middle">

									<nav:showPath
										module='<%=(String) session.getAttribute("modulo")%>'
										subModule='<%=(String) session.getAttribute("submodulo")%>'
										function='<%=(String) session.getAttribute("funcion")%>' />

								</td>
								<td style="width: 15px; height: 46px;">
									<img src="/agvWeb/images/TopRight.png"
										style="margin: 0px; width: 15px; height: 46px; vertical-align: bottom;"
										alt="" />
								</td>
							</tr>
							<tr>
								<td
									style="width: 15px; background-image: url('/agvWeb/images/Left.png'); background-repeat: repeat-y;">

								</td>
								<td
									style="height: 100%; height: 100%; padding-left: 5px; padding-right: 5px; text-align: left; padding-bottom: 5px; vertical-align: top; background-color: #FFFFFF;">


									<div id="container">
										<div id="content_main">
											<table style="height: 100%; width: 100%">
												<tr valign="middle" style="height: 30%">
													<td align="center">
														<h4>
															Ocurrió un error al procesar su petición
															<br />
														</h4>
													</td>
												</tr>
												<tr valign="top" style="height: 30%">
													<td align="center">
														<img src="<html:rewrite page='/images/soporte.gif' />"
															border="0" />
													</td>
												</tr>
												<tr valign="top" style="height: 30%">
													<td align="center">
														<html:errors />
													</td>
												</tr>
											</table>
										</div>
									</div>


								</td>
								<td
									style="width: 15px; height: 100%; background-image: url('/agvWeb/images/Right.png'); background-repeat: repeat-y;">
								</td>
							</tr>
							<tr>
								<td style="width: 15px; height: 15px;">
									<img src="/agvWeb/images/BottomLeft.png"
										style="margin: 0px; width: 15px; height: 15px;" alt="" />
								</td>
								<td
									style="width: 100%; background-image: url('/agvWeb/images/Bottom.png'); background-repeat: repeat-x;">
								</td>
								<td style="width: 15px; height: 15px;">
									<img src="/agvWeb/images/BottomRight.png"
										style="margin: 0px; width: 15px; height: 15px;" alt="" />
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr class="footerleft">
					<td>
						<div class="footercenter" style="width: 99%;">
							<span class="footerright"
								style="height: 38px; width: 100%; vertical-align: middle;">
								<table align="center">
									<tr valign="middle">
										<td
											style="font-family: Calibri; font-size: 12px; color: #FFFFFF; font-weight: bold; width: 100%"
											align="right" valign="middle">
											&copy; Copyright AGV Software 2011
										</td>
									</tr>
								</table> </span>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</body>
</html>

